package com.mofang.activity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;

import com.mofang.MoFangApplication;
import com.pactera.framework.util.Loger;
import com.umeng.analytics.MobclickAgent;

/**
 * @author P0033759 最后修改时间 2014-2-17-下午4:44:57 功能 应用页面访问情况统计
 */
public class BaseActivity extends Activity {

	private String pageName = "";

	protected Context mContext;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = this;
		//Loger.d("this:" + this.getClass());
		Class<?> clazz = getClass();
		pageName = clazz.getSimpleName();
		Loger.d("pageName:" + pageName);
		((MoFangApplication) MoFangApplication.getApp()).addActivity(this);
		initView();
		setListener();
	}

	protected void initView() {

	}

	protected void setListener() {

	}

	@Override
	protected void onRestart() {
		super.onRestart();
	}

	@Override
	protected void onStart() {
		super.onStart();
	}

	@Override
	protected void onResume() {
		super.onResume();
		MobclickAgent.onPageStart(pageName);
		MobclickAgent.onResume(this);
	}

	@Override
	protected void onPause() {
		super.onPause();
		MobclickAgent.onPageEnd(pageName);
		MobclickAgent.onPause(this);
	}

	@Override
	protected void onStop() {
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}
}
